clear all 
set more off 
set maxvar 15000 
clear matrix

	use "$Mydirectory1/3_Output/2_PooledData_analysis.dta", clear 
    keep if baseline_sample==1

* Obtain variance in predicted father income, by decade
    levelsof decade, local(decades)

    gen dad_var =.

    foreach d of local decades {
        summ father_income_baseline [aw=wgt_sex_race] if decade==`d'
        replace dad_var =`r(Var)' if decade==`d'
        di "`r(Var)'"
    }

    bysort decade: keep if _n==1
    keep decade dad_var

    #delimit ;
        twoway (connect dad_var decade, mcolor(lavender*1.15) 
                msymbol(diamond) lpat(solid) lwidth(0.25) lcolor(lavender*1.15)),
                xtitle(" " "Decade of respondent's birth") 
                xlabel(1910(10)1970) xscale(range(1905 1975)) 
                ylabel(0(.04)0.2)
                ytitle("Variance" " ")  
                ;   
    #delimit cr
    graph export "$Mydirectory2/appendix_a/dadinc_variance_bydecade.pdf", as(pdf) replace 

